<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>静态成员</title>
</head>
<body>
    <script>
        //类的成员称之为静态成员
        // function Phone(){}

        // //为 Phone 添加属性以及方法
        // Phone.name = '手机';
        // Phone.change = function(){
        //     console.log('改变了世界');
        // };

        // //实例化对象
        // let xiaomi = new Phone();

        // console.log(xiaomi.name);

        class Phone{
            //静态成员
            static name = '手机';
            static change = function(){
                console.log('改变了世界');
            }
        }

        let onePlus = new Phone();

        console.log(onePlus.name);
        console.log(Phone.name);
    </script>
</body>
</html>